home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 15.asm < prev    next >
Assembly Source File  |  1999-09-06  |  910b  |  28 lines

  1. * 15.asm   Beep the screen          version 0.00    1.9.97
  2.  
  3.  xref _AbsExecBase       ; There must be XREF's for _AbsExecBase, and
  4.  xref _LVOOpenLibrary    ; all ROM Kernal libraries. The XREF's must
  5.  xref _LVOCloseLibrary   ; prepend _LVO before the library names.
  6.  xref _LVODisplayBeep
  7.  
  8.  move.l _AbsExecBase,a6  ;open intuition.library
  9.  lea intname,a1
  10.  moveq #37,d0            ;at least version 37 (i.e. release 2.04)
  11.  jsr _LVOOpenLibrary(a6)
  12.  move.l d0,intbase       ;D0 points to library base, or 0 if couldn't open
  13.  beq.s Abort             ;go if couldn't open
  14.  move.l intbase,a6
  15.  sub.l a0,a0             ;a0=0 to beep all screens
  16.  jsr _LVODisplayBeep(a6) ;beep screens
  17.  move.l _AbsExecBase,a6  ;close intuition.library
  18.  move.l intbase,a1
  19.  jsr _LVOCloseLibrary(a6)
  20.  clr.l d0                ;quit good
  21.  rts
  22. Abort:
  23.  moveq #-1,d0            ;quit bad
  24.  rts
  25.  
  26. intname: dc.b 'intuition.library',0
  27. intbase: ds.l 1
  28.